const express = require('express');
const router = express.Router();
const surveyController = require('../controllers/surveyController');

// 获取随机问卷
router.get('/random', surveyController.getRandomSurvey.bind(surveyController));

// 获取问卷列表
router.get('/list', surveyController.getSurveyList.bind(surveyController));

// 根据ID获取问卷详情
router.get('/:id', surveyController.getSurveyById.bind(surveyController));

// 获取问卷统计信息
router.get('/:id/stats', surveyController.getSurveyStats.bind(surveyController));

// 检查学生是否已完成问卷
router.get('/check/:studentId/:surveyId', surveyController.checkSurveyCompletion.bind(surveyController));

// 提交问卷回答
router.post('/submit', surveyController.submitSurveyResponse.bind(surveyController));

module.exports = router;